//C09:ErrTest.cpp
// {T} ErrTest.cpp
#include "../require.h"
#include <fstream>
using namespace std;

int main(int argc, char *argv[])
{
    int i = 1;
    require(i, "value must be nonzero");
    requireArgs(argc, 1);
    requireMinArgs(argc, 1);
    ifstream in(argv[1]);
    assure(in, argv[1]);    // Use the file name
    ifstream nofile("nofile.xxx");
    // Fails:
    // ! assure(nofile);    // The default argument
    ofstream out("tmp.txt");
    assure(out);
}